/**
*      author: Y_Yao
*      created: 2025-04-04 10:40:47
**/

#include<bits/stdc++.h>

#define int LL
using namespace std;
using LL = long long;
const LL LLINF = 9e18;
const int INF = 0x3f3f3f3f;
const int N = 6 + 1;
const int M = 2200 + 7;;
char a[M][M];
int k;

void color(int x,int y,int len)
{
    for(int i = x;i < x + len;i++)
    {
        for(int j = y;j < y + len;j++)
        {
            a[i][j] = a[i-x][j-y];
        }
    }
}

void solve()
{
    memset(a,'.',sizeof a);
    a[0][0] = '#';
    cin >> k;
    int len = 1;
    for(int i = 1;i <= k;i++)
    {
        for(int x = 0;x < 3;x++)
        {
            for(int y = 0;y < 3;y++)
            {
                if(x == y && y == 1) continue;
                color(x * len,y * len,len);
            }
        }
        len *= 3;
    }
    for(int i = 0;i < len;i++)
    {
        for(int j = 0;j < len;j++)
        {
            cout << a[i][j];
        }
        cout << endl;
    }
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 1;
    // cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}